<% layout("/common/layout.html",{"title":"流程列表"}){ %>
<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-sm-8">
        <h2>食药变更列表</h2>
       	<ol class="breadcrumb">
			<li><a href="${ctxPath}/admin/main">主页</a></li>
			<li>食药变更列表</li>
		</ol>
    </div>
     <div class="col-sm-4">
		<div class="title-action">
			<a class="btn btn-primary btn-sm btn-outline" href="/fooddrugChange/view/report"><i
				class="fa fa-bar-chart"> </i> 变更统计</a>
		</div>
	</div>
</div>
<div class="wrapper wrapper-content">

    <div class="row">

                <form id="searchForm">
            <div class="ibox-content m-b-sm border-bottom">
                <div class="row">

                    <div class="col-sm-2">
                        <div class="form-group">
                            <label class="control-label" for="searchValue">申请编号：</label>
                            <input type="text" class="form-control" id="id" name="id" placeholder="申请编号">
                        </div>
                    </div>

                    <div class="col-sm-4">
                        <div class="form-group">
                            <label class="control-label" for="companyAddress">企业名称：</label>
                            <input type="text" class="form-control" id="itemName" name="itemName" placeholder="企业名称，支持模糊查询">
                        </div>
                    </div>

                    <div class="col-sm-2">
                        <div class="form-group">
                            <label class="control-label" for="itemStatus">申请状态：</label>
                             <select class="form-control" id="itemStatus" name="itemStatus">
                              <option class="" >全部</option>
                                <%
                                for(status in fooddrugApplyStatus){
                                %>
                                <option value="${status.key}" >${status.value}</option>
                                <%
                                }
                                %> 
                            </select>
                        </div>
                    </div>



                    <div class="col-sm-2 pull-right">
                        <div class="form-group">
                            <label class="control-label" for="search">&nbsp;</label>
                            <div class="btn-block text-right">
                                <button type="button" id="search" class="btn btn-primary "><i class="fa fa-search"></i>&nbsp;搜 索&nbsp;</button>
                                <button type="reset" id="reset" class="btn btn-danger"><i class="fa fa-undo"></i>&nbsp;重 置&nbsp;</button>
                            </div>
                        </div>
                    </div>
                </div>

            </div>
        </form>

        <div class=" animated fadeInDown">
            <div class="mail-box">
                <div class="ibox-content">
                    <table id="dataList"></table>
                    <div class="toolBar pull-right">
                            <div class="btn-group">
                                <a href="index" class="btn btn-primary btn-outline ${stepNode == 'claim'?'active'}"><i class="fa fa-lock" aria-hidden="true"></i>&nbsp;申请认领</a>
                                <a href="handle" class="btn btn-primary btn-outline ${stepNode == 'handle'?'active'}"><i class="fa fa-retweet" aria-hidden="true"></i>&nbsp;审核办理</a>
                                <a href="refuse" class="btn btn-primary btn-outline ${stepNode == 'refuse'?'active'}"><i class="fa fa-reply" aria-hidden="true"></i>&nbsp;退回修改</a>
                                <a href="pass" class="btn btn-primary btn-outline ${stepNode == 'pass'?'active'}"><i class="fa fa-check" aria-hidden="true"></i>&nbsp;核准通过</a>
                            </div>
                    </div>
                </div>
            </div>
        </div>

        <!-- 表格-->
        <div class=" animated fadeInDown">
            <div class="mail-box">
                <div class="ibox-content">
                    <table id="dataList"></table>
                </div>
            </div>
        </div>
        <!-- 表格-->
    </div>
</div>
<% } %>
<script type="text/javascript">
    //页面JS调用
    require(['fooddrug/apply'], function (apply) {
        apply.list('${stepNode}');
    });
     //列表参数
    function operateFormatter(value, row, index) {
        var tempCode = "";
         <%  if(shiro.hasPermission("/fooddrugChange/preExamine/index")) { %>
            if(row.itemStatus == 1){
                tempCode += '<button type="button" class="preExamineClaim btn btn-white"><i class="fa fa-lock"></i>&nbsp;预审认领&nbsp;</button>';
            }
            if(row.itemStatus == 2){
            	tempCode += '<button type="button" class="evaluate btn btn-white"><i class="fa fa-random"></i>&nbsp;信息核准&nbsp;</button>';
                tempCode += '<button type="button" class="preExamineAgree btn btn-white"><i class="fa fa-random"></i>&nbsp;预审通过&nbsp;</button>';
                tempCode += '<button type="button" class="preExamineRefuse btn btn-white"><i class="fa fa-random"></i>&nbsp;预审拒绝&nbsp;</button>';
            }
        <% } %>
        <%  if(shiro.hasPermission("/fooddrugChange/examine/index")) { %>
            if(row.itemStatus == 4){
                tempCode += '<button type="button" class="examineClaim btn btn-white"><i class="fa fa-lock"></i>&nbsp;初审认领&nbsp;</button>';
            }
            if(row.itemStatus == 5){
                tempCode += '<button type="button" class="examineAgree btn btn-white"><i class="fa fa-random"></i>&nbsp;初审通过&nbsp;</button>';
                tempCode += '<button type="button" class="examineRefuse btn btn-white"><i class="fa fa-random"></i>&nbsp;初审拒绝&nbsp;</button>';
            }
        <% } %>
        <%  if(shiro.hasPermission("/fooddrugChange/reExamine/index")) { %>
        if(row.itemStatus == 7){
            tempCode += '<button type="button" class="reExamineClaim btn btn-white"><i class="fa fa-lock"></i>&nbsp;复审认领&nbsp;</button>';
        }
        if(row.itemStatus == 8){
            tempCode += '<button type="button" class="reExamineAgree btn btn-white"><i class="fa fa-random"></i>&nbsp;复审通过&nbsp;</button>';
            tempCode += '<button type="button" class="reExamineRefuse btn btn-white"><i class="fa fa-random"></i>&nbsp;复审拒绝&nbsp;</button>';
        }
    <% } %>
        <% if(shiro.hasPermission("/fooddrugChange/view/index")) { %>
            tempCode += '<button type="button" class="detail btn btn-white"><i class="fa fa-info-circle"></i>&nbsp;详情&nbsp;</button>';
        <%  } %>
        <%  if(shiro.hasPermission("/fooddrugChange/delete/action")) { %>
            tempCode += '<button type="button" class="delete btn btn-white">&nbsp;<i class="fa fa-trash"></i>&nbsp;删除&nbsp;</button>';
        <%  } %> 
        return '<div class="btn-group btn-group-xs">' + tempCode + '</div>';
    } 
</script>